package com.vmj.instructions.extended;

import com.vmj.heap.VMObject;
import com.vmj.instructions.base.BranchInstruction;
import com.vmj.rtda.Frame;

/**
 * Created by yangshoujun on 2017/9/10 上午12:26.
 */
public class IfNull extends BranchInstruction {
    @Override
    public void execute(Frame frame) {
        VMObject ref = frame.getOperandStack().popRef();
        if(ref == null) {
            BranchInstruction.branch(frame, getOffset());
        }
    }
}
